<?php include atemplate('header');?>

<table width="96%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="200" height="30" align="left" bgcolor="#B51C00"> 　<span class="STYLE8">灯谜管理（共有<?php echo $count;?>条）</span></td>
    <td align="right" bgcolor="#B51C00">&nbsp;</td>
    <td width="100" align="center" bgcolor="#B51C00">&nbsp;</td>
    <td width="100" align="center" bgcolor="#B51C00">&nbsp;</td>
  </tr>
</table>
<form action="/admin/index.php?do=guess&ac=list&" method="get">
  <table width="96%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="190" height="30" align="left">发布
        <select name="ifcheck" id="ifcheck">
          <option value="-1">所有</option>
          <option value="1" <?php echo $ifcheck_1;?>>已发布</option>
          <option value="0" <?php echo $ifcheck_0;?>>未发布</option>
        </select> 猜中<select name="ifanswer" id="ifanswer">
          <option value="-1">所有</option>
          <option value="1" <?php echo $ifanswer_1;?>>已猜中</option>
          <option value="0" <?php echo $ifanswer_0;?>>未猜中</option>
        </select></td>
      <td align="left"><input name="keyword" type="text" class="STYLE2" id="keyword" value="<?php echo $keyword;?>"/>
      <input type="hidden" name="ac" value="list"  />
      <input type="hidden" name="do" value="guess" />
        <input type="submit"  id="button23" value="灯谜检索" /></td>
      <td width="100" align="center">&nbsp;</td>
      <td width="100" align="center"><a href="/admin/index.php?do=guess&ac=add">灯谜录入</a></td>
    </tr>
  </table>
</form>
<table width="96%" border="0" cellpadding="0" cellspacing="1" bgcolor="#999999">
  <tr>
    <td align="center" valign="middle" bgcolor="#FAFAFA" class="STYLE7">ID</td>
    <td height="30" align="center" bgcolor="#FAFAFA" class="STYLE7">灯 谜 列 表</td>
    <td align="center" valign="middle" bgcolor="#FAFAFA" class="STYLE7">答 案</td>
    <td align="center" valign="middle" bgcolor="#FAFAFA" class="STYLE7">提示</td>
    <td align="center" valign="middle" bgcolor="#FAFAFA" class="STYLE7">简单</td>
    <td align="center" valign="middle" bgcolor="#FAFAFA" class="STYLE7">发布</td>
    <td align="center" valign="middle" bgcolor="#FAFAFA" class="STYLE7">被猜中</td>
    <td height="40" colspan="4" align="center" valign="middle" bgcolor="#FAFAFA" class="STYLE7">操 作</td>
  </tr>
  <?php foreach ($list as $key=>$val) {
	$key %2 == 1 ? $bgcolor = 'bgcolor="#FAFAFA"' : $bgcolor = 'bgcolor="#FFFFF7"';
?>
  <tr <?php echo $bgcolor;?>>
    <td width="40" align="center" valign="middle" class="STYLE7"><?php echo $val['id'];?></td>
    <td height="30" align="left" ><a href="#" class="link2"><?php echo $val['title'];?></a></td>
    <td width="140" align="center" valign="middle" ><?php echo $val['answer'];?></td>
    <td width="140" align="center" valign="middle" ><?php echo $val['prompt'];?></td>
    <td width="60" align="center" valign="middle"><?php echo $val['ifsimple']?'是':'否';?></td>
    <td width="60" align="center" valign="middle"><?php echo $val['ifcheck']?'是':'否';?></td>
    <td width="60" align="center" valign="middle"><?php echo $val['ifanswer']?'是':'否';?></td>
    <td width="60" height="40" align="center" valign="middle"><a href="/admin/index.php?do=guess&ac=edit&id=<?php echo $val['id'];?>">编辑</a></td>
    <td width="60" align="center" valign="middle"><a href="/admin/index.php?do=guess&ac=del&id=<?php echo $val['id'];?>"  onclick="return confirm('是否删除该灯谜！');">删除</a></td>
    <td width="60" align="center" valign="middle"><a href="/admin/index.php?do=guess&ac=check&id=<?php echo $val['id'];?>">发布</a></td>
    <td width="60" align="center" valign="middle"><a href="/admin/index.php?do=guess&ac=uncheck&id=<?php echo $val['id'];?>">取消发布</a></td>
  </tr>
  <?php }?>
</table>
<table width="96%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30" align="right" class="page"><?php echo $pagestr;?></td>
  </tr>
</table>
<?php include atemplate('footer');?>
